home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlComboSetTopIndex.au3 < prev    next >
Text File  |  2007-09-08  |  899b  |  30 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiCombo.au3>
  3.  
  4. Opt('MustDeclareVars',1)
  5.  
  6. Dim $Combo,$ret,$Btn_Exit,$msg,$ret,$Label,$Input,$Btn_Set
  7.  
  8. GuiCreate("ComboBox Set Top Index", 392, 254)
  9.  
  10. $Label = GuiCtrlCreateLabel("Enter Top Index", 80, 20, 120, 20)
  11. $Input = GuiCtrlCreateInput("", 160, 20, 50, 20,$ES_NUMBER)
  12. GUICtrlSetLimit($Input,2)
  13. $Btn_Set = GuiCtrlCreateButton("Set", 160, 50, 90, 30)
  14. $Combo = GuiCtrlCreateCombo("", 70, 100, 270, 80,BitOR($CBS_SIMPLE,$CBS_DISABLENOSCROLL,$WS_VSCROLL))
  15. $ret = _GUICtrlComboAddDir($Combo,"drives")
  16. $Btn_Exit = GuiCtrlCreateButton("Exit", 150, 200, 90, 30)
  17. GuiSetState()
  18. While 1
  19.     $msg = GuiGetMsg()
  20.     Select
  21.         Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  22.             ExitLoop
  23.         Case $msg = $Btn_Set
  24.             If(StringLen(GUICtrlRead($Input)) > 0) Then
  25.                 _GUICtrlComboSetTopIndex($Combo,Int(GUICtrlRead($Input)))
  26.             EndIf
  27.     EndSelect
  28. WEnd
  29. Exit
  30.